export const ADD_TODO = 'ADD_TODO';
export function addTodo(value) {
  return {
    type: ADD_TODO,
    value,
    completed: false
  };
}

export const DEL_TODO = 'DEL_TODO';
export function delTodo(index) {
  return {
    type: DEL_TODO,
    index
  };
}

export const COMPLETE_TODO = 'COMPLETE_TODO';
export function completeTodo(index, completed) {
  return {
    type: COMPLETE_TODO,
    index,
    completed
  };
}

export const EDIT_TODO = 'EDIT_TODO';
export function editTodo(index, value) {
  return {
    type: EDIT_TODO,
    index,
    value
  };
}

export const GET_EDIT_CONTENT = 'GET_EDIT_CONTENT';
export function getEditContent(value) {
  return {
    type: GET_EDIT_CONTENT,
    value
  };
}

export const CLEAR_EDIT_CONTENT = 'CLEAR_EDIT_CONTENT';
export function clearEditContent() {
  return {
    type: CLEAR_EDIT_CONTENT
  };
}

export const GET_EDIT_INDEX = 'GET_EDIT_INDEX';
export function getEditIndex(index) {
  return {
    type: GET_EDIT_INDEX,
    index
  };
}

export const CHANGE_TEXT = 'CHANGE_TEXT';
export function changeText(text) {
  return {
    type: CHANGE_TEXT,
    text
  };
}